package day1215_3;

import java.awt.*;

public class T1  extends  Thread{
    public static void main(String[] args) {
        Color c=new Color(0,0,0);
        T1  thread1=new T1();  thread1.suo=c;   thread1.start();
        T1  thread2=new T1();  thread2.suo=c;   thread2.start();
    }

    Object suo;
    public void run() {
        synchronized(suo){
            System.out.println("试衣服");
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
